﻿CREATE VIEW [dbo].[HoursSummary]
AS
SELECT     TOP 100 PERCENT dbo.EntryLog.EntryDate, dbo.Projects.Name, dbo.Categories.Name AS Category, dbo.EntryLog.CategoryID, 
                      dbo.EntryLog.Description, dbo.EntryLog.ProjectID, dbo.EntryLog.Duration
FROM         dbo.EntryLog INNER JOIN
                      dbo.Projects ON dbo.EntryLog.ProjectID = dbo.Projects.ProjectID INNER JOIN
                      dbo.Users ON dbo.EntryLog.UserID = dbo.Users.UserID INNER JOIN
                      dbo.Categories ON dbo.EntryLog.CategoryID = dbo.Categories.CategoryID
WHERE     (dbo.Users.UserName = N'sftsrc\maria.parker') AND (dbo.EntryLog.HasBeenBilled = 0) AND (dbo.EntryLog.EntryDate > CONVERT(DATETIME, 
                      '2005-05-01 00:00:00', 102))
ORDER BY dbo.EntryLog.EntryDate;

